package com.wlm.minio.controller;


import com.wlm.minio.config.R;
import com.wlm.minio.service.MinioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class MinioController {

    @Autowired
    public MinioService minioService;

    @PostMapping("/upload")
    public R upload(@RequestBody MultipartFile file) {
        return  R.ok().put("url",minioService.uploadFile("json",file));
    }

}
